package dry.example.gui;

import java.awt.GraphicsDevice;
import java.awt.GraphicsEnvironment;
import java.awt.Rectangle;

public class MultiMonitorResolutionExample {
    public static void main(String[] args) {
        GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
        GraphicsDevice[] screens = ge.getScreenDevices();

        for (int i = 0; i < screens.length; i++) {
            Rectangle bounds = screens[i].getDefaultConfiguration().getBounds();
            System.out.println("显示器 " + (i + 1) + ":");
            System.out.println("  X: " + bounds.x);
            System.out.println("  Y: " + bounds.y);
            System.out.println("  宽度: " + bounds.width);
            System.out.println("  高度: " + bounds.height);
        }
    }
}
